import { ReturnType, customError, post } from '..'
import { UpgradeInfo } from '../interface'
import { URL_UPGRADE, URL_UPGRADE_INFO } from '../base/url'

export const upgradeInfo = async (): Promise<ReturnType<UpgradeInfo | undefined>> => {
    try {
        const result = await post<UpgradeInfo>(URL_UPGRADE_INFO)
        return result
    } catch (error: any) {
        return customError(error)
    }
}


export const upgrade = async (params: { type: string }): Promise<ReturnType<undefined>> => {
    try {
        return await post(URL_UPGRADE, params)
    } catch (error: any) {
        return customError(error)
    }
}

